const mongoose = require('mongoose');

const campusNoticeSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true
  },
  content: {
    type: String,
    required: true
  },
  cover: String,
  category: {
    type: String,
    enum: ['academic', 'facility', 'health', 'activity', 'other', 'dining', 'safety', 'organization'],
    default: 'other'
  },
  date: {
    type: Date,
    default: Date.now
  },
  userId: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User'
  }
});

const CampusNoticeSchema = new mongoose.Schema({
  tag: String,
  title: String,
  date: String
});

module.exports = mongoose.model('CampusNotice', CampusNoticeSchema);
